# Interface messages will be get from the database.
$wgUseDatabaseMessages = true;
$wgMsgCacheExpiry = 86400;
-
-
+$wgPartialMessageCache = false;
# Miscellaneous configuration settings
#
}
/**
- * Loads all cacheable messages from the database
+ * Loads all or main part of cacheable messages from the database
*/
function loadFromDB() {
- $fname = 'MessageCache::loadFromDB';
+ global $wgPartialMessageCache;
+ $fname = 'MessageCache::loadFromDB';
$dbr =& wfGetDB( DB_SLAVE );
+ $conditions = array( 'cur_is_redirect' => 0,
+ 'cur_namespace' => NS_MEDIAWIKI);
+ if ($wgPartialMessageCache) {
+ if (is_array($wgPartialMessageCache)) {
+ $conditions['cur_title']=$wgPartialMessageCache;
+ } else {
+ require_once("MessageCacheHints.php");
+ $conditions['cur_title']=MessageCacheHints::get();
+ }
+ }
$res = $dbr->select( 'cur',
- array( 'cur_title', 'cur_text' ),
- array( 'cur_is_redirect' => 0, 'cur_namespace' => NS_MEDIAWIKI ),
- $fname
- );
+ array( 'cur_title', 'cur_text' ), $conditions, $fname);
$this->mCache = array();
for ( $row = $dbr->fetchObject( $res ); $row; $row = $dbr->fetchObject( $res ) ) {
--- /dev/null
+<?
+
+/*
+ * @package Mediawiki
+ * @version $Id$
+ *
+ * This class should provide methods for message
+ * cache key hints for various scopes */
+
+class MessageCacheHints {
+ function get($scope="global") {
+ return array('TODO');
+ }
+}
+
+?>